package org.zjh.controller.listener;

import org.zjh.controller.GameController;
import org.zjh.model.RealPlayer;
import org.zjh.view.ui.GameUi;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 * @description: 切换账号按钮监听
 * @author 郑佳豪
 * @date 2024/10/4 21:54
 * @version 1.0
 */
public class LoginChangeJbtLis extends MouseAdapter {

    @Override
    public void mouseClicked(MouseEvent e) {
        //将当前玩家赋值为空 返回到登入界面重新登入
        GameController.getInstance().setPlayer(new RealPlayer());
        //将当前页面销毁
        GameUi.gameMenuFrame.dispose();
        GameUi.gameMenuFrame = null;
        //将设置可见
        GameUi.loginFrame.setVisible(true);
    }
}
